package com.lxx;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-bean.xml");
        Student student = (Student) context.getBean("student");
        System.out.println(student);
        /**
         Student{
              name='liuxu',
              address=Address{address='北京市'},
              hobbys=[听歌, 敲代码, 打王者],
              arrys=[西游记, 红楼梦, 三国演义],
              map={身份证=188888888888886666, 手机号=18888888888},
              set=[身高, 体重],
              info={password=root, host=localhost, driver=mysql驱动, username=root},
              wife='null'
         }
         */
    }

    @Test
    public void testPC(){
        ApplicationContext context = new ClassPathXmlApplicationContext("pcbean.xml");
        PCNameSpace pc = context.getBean("pc", PCNameSpace.class);
        PCNameSpace pc2 = context.getBean("pc2", PCNameSpace.class);
        System.out.println(pc);
        System.out.println(pc2);
    }
}
